<script type="text/javascript">
$(function() {
    //$( document ).tooltip({ hide: { effect: "explode", duration: 1000 } });
    $('#inventory_time').datetimepicker({
    		  dateFormat: 'yy-mm-dd',
        	  timeFormat: 'HH:mm:ss',  maxDate: new Date(),}
    	    );
	$(".supplierform").Validform({
		        tiptype:2,
		        ajaxPost:true,
				callback:function(data){
					if(data.status=='y'){
						$("input[name='re_quantity']").val($("input[name='quantity']").val());
						}
					setTimeout(function(){
						$.Hidemsg(); 
					},3000);
				}
        });

     });
</script>
<div class="row">
  <div class="span6"><form class="supplierform" method="post" action="<?php  echo URL::base() ?>inventory/report/out_edit_to">
           <input type="hidden" name="id" value="<?php echo $delivery['id']?>">
            <table class="table ">
                <tr>
                    <td width="30">*</td>
                    <td width="120">选择仓库：</td>
                    <td>
                        <select id='warehouseid' name='warehouseid'>
                            <?php foreach ($warehouse as $id => $name) { ?>
                                <option value="<?php echo $id ?>"><?php echo $name ?></option>
                            <?php } ?>
                        </select>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td width="30">*</td>
                    <td width="120">选择主体：</td>
                    <td>
                        <select id='enterprise_dominant' name='enterprise_dominant'>
                            <option value="0">--请选择--</option>
                            <?php foreach ($enterprise_dominants as $id => $name) { ?>
                                <option value="<?php echo $id ?>"><?php echo $name ?></option>
                            <?php } ?>
                        </select>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td class="need" style="width:10px;">*</td>
                    <td style="width:70px;">出库类型：</td>
                    <td style="width:205px;">
                    <select name="type" datatype="*" >
                    <?php foreach ($status as $s):?>
					  <option value="<?php echo $s['number']?>" <?php if($s['number']==$delivery['type']) echo 'selected'; ?>><?php echo $s['value'] ?></option>
					<?php endforeach;?>
					 </select>
						</td>
                    <td><div class="Validform_checktip"></div></td>
                </tr>
                <tr>
                    <td>*</td>
                    <td > SKU：</td>
                    <td><input type="text" value="<?php echo $delivery['sku']?>"  name="sku" class="inputxt" datatype="*"  readonly = "readonly" sucmsg="SKU验证通过"  errormsg="输入的SKU有误" /></td>
                    <td><div class="Validform_checktip"></div></td>
                </tr>
                <tr>
                    <td>*</td>
                    <td > 中文名称：</td>
                    <td><input type="text" value="<?php echo $delivery['sku_name']?>"   name="sku_name" class="inputxt"  datatype="*"   readonly = "readonly" /></td>
                    <td><div class="Validform_checktip"></div></td>
                </tr>
                  <tr>
                    <td>*</td>
                    <td > 储位：</td>
                    <td><input type="text" value="<?php echo $delivery['storage_position']?>"   name="storage_position" class="inputxt"   readonly = "readonly" /></td>
                    <td><div class="Validform_checktip"></div></td>
                </tr>
                  <tr>
                    <td>*</td>
                    <td> 数量：</td>
                    <td><input type="text" value="<?php echo $delivery['quantity']?>"   name="quantity" class="inputxt"  datatype="/^[1-9](\d+)?$/" errormsg="数量只能为正整数"  /></td>
                    <td><input type="hidden" value="<?php echo $delivery['quantity']?>"   name="re_quantity"  /></td>
                    <td><div class="Validform_checktip"></div></td>
                </tr>
                <tr>
                    <td class="need">*</td>
                    <td > 备注：</td>
                    <td ><input type="text" value="<?php echo $delivery['remark']?>"  name="remark" class="inputxt"    /></td>
                    <td><div class="Validform_checktip"></div></td>
                </tr>
                <tr>
                    <td class="need">*</td>
                    <td > 出库时间：</td>
                    <td ><input type="text" value="<?php echo $delivery['delivery_date']?>" name="delivery_date" class="inputxt"  id='inventory_time'  datatype="*" readonly="readonly"/></td>
                    <td><div class="Validform_checktip"></div></td>
                </tr>
                <tr>
                    <td class="need"></td>
                    <td></td>
                    <td colspan="2">
                        <input type="submit" value="提 交" class='btn btn-success'/>&nbsp;&nbsp;&nbsp; <input type="reset" value="重 置" class='btn btn-inverse' />
                    </td>
                </tr>
            </table>
        </form>
        </div>
  </div>
